<!DESCRIPTION>Strips the characters from an input string. You can change the characters you want removed from the string by changing one line of code.<!/DESCRIPTION>
<!CATEGORY>Forms<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL STRIP CHARACTERS:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ryan A. Somma (ryan@waygate.com) -->
<!-- Web Site: http://www.waygate.com -->
<!-- Begin
function stringFilter (input) {
s = input.value;
filteredValues = "1234567890"; // Characters stripped out
var i;
var returnString = "";
for (i = 0; i < s.length; i++) { // Search through string and append to unfiltered values to returnString.
var c = s.charAt(i);
if (filteredValues.indexOf(c) == -1) returnString += c;
}
input.value = returnString;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<font face=arial size=-2>
<p>This demo form will filter out all numeric values from the form below. Enter a combination of alpha and numeric characters and click "Submit" to view the results.
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ryan A. Somma (ryan@waygate.com) -->
<!-- Web Site: http://www.waygate.com -->
<!-- Begin
function stringFilter (input) {
s = input.value;
filteredValues = "1234567890"; // Characters stripped out
var i;
var returnString = "";
for (i = 0; i < s.length; i++) { // Search through string and append to unfiltered values to returnString.
var c = s.charAt(i);
if (filteredValues.indexOf(c) == -1) returnString += c;
}
input.value = returnString;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<font face=arial size=-2>
<p>This demo form will filter out all numeric values from the form below. Enter a combination of alpha and numeric characters and click "Submit" to view the results.